SOCK_SEQPACKET UNIX Socket Fallback and Direct Shebang Execution#111
SOCK_SEQPACKET UNIX Socket Fallback and Direct Shebang Execution#111doanbaotrung wants to merge 1 commit into
Conversation
66ce56b to
c1e7082
Compare
|
Fix #104 |
There was a problem hiding this comment.
3 issues found and verified against the latest diff
Reply with feedback, questions, or to request a fix.
Re-trigger cubic
99a45a3 to
c8288ed
Compare
Max042004
left a comment
There was a problem hiding this comment.
by the way, provide SEQPACKET test.
| } | ||
|
|
||
| /* Check if the file starts with "#!" */ | ||
| FILE *f = fopen(elf_host_path, "r"); |
There was a problem hiding this comment.
src/syscall/exec.c 340~415 already have binfmt_script parsing algorithm. Consider refactoring to use shared helper function.
6bd73c7 to
a051ad4
Compare
Changes[MODIFY] elf.h
[MODIFY] elf.c
[MODIFY] main.c
[MODIFY] exec.c
[MODIFY] test-socket.c
Verification PlanAutomated Tests
|
a051ad4 to
de4fb2c
Compare
|
On Two possible way to implement SEQPACKET:
|
de4fb2c to
3b0b28b
Compare
Updated sys_socket and sys_socketpair to automatically downgrade AF_UNIX sockets of type SOCK_SEQPACKET to SOCK_STREAM on macOS hosts. Initialized the socket options cache using the original LINUX_SOCK_SEQPACKET type, ensuring getsockopt queries for SO_TYPE correctly report SOCK_SEQPACKET to the guest. Provide SEQPACKET test: Add test cases to test-socket.c o cover UNIX domain SOCK_SEQPACKET sockets and socketpairs, verifying that getsockopt SO_TYPE correctly returns SOCK_SEQPACKET. Direct Shebang Execution Refactor shebang parsing logic: Extract the duplicate binfmt_script parsing logic from main.c and exec.c into a shared helper function elf_parse_shebang defined in elf.c and declared in elf.h.
3b0b28b to
d6f2d70
Compare
Changes Madeshebang / binfmt_script Refactoring
SOCK_SEQPACKET Emulation & Boundary Preservation Tests
Verification & TestingSecurity CheckAll security checks passed: bash .ci/check-security.sh
# Output: Security checks passed.Compilation
Execution ResultsExecuted |
Summary by cubic
Add a macOS-safe fallback for AF_UNIX
SOCK_SEQPACKETand support direct shebang execution with recursive interpreter resolution.socketmaps toSOCK_STREAMandsocketpairtoSOCK_DGRAM, whilegetsockopt(SO_TYPE)still returnsSOCK_SEQPACKET.New Features
SOCK_SEQPACKETfallback:socket→SOCK_STREAM,socketpair→SOCK_DGRAM; cache original type soSO_TYPEreportsSOCK_SEQPACKET; tests for both paths.elf_path, clean temp files.Refactors
elf_parse_shebanginelf.c, reused inmainandsys_execvefor consistent behavior.Written for commit d6f2d70. Summary will update on new commits.